#include "lvgl.h"

/*******************************************************************************
 * Tool: MCU_Font V2.0
 * Time: 2020-11-14 16:58:28
 * Bpp: 4
 * LineHeight: 27 px
 * BaseLine: 3
 * 
 * FontCount: 2
 * FontSize_1: 16px  FontFamily_1: iconfont  
 * FontSize_2: 9px  FontFamily_2: 黑体  
 ******************************************************************************/

#ifndef RUN_FONT_16
#define RUN_FONT_16 1
#endif

#if RUN_FONT_16

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {

    /* U+20 " " */
    0x0, 

    /* U+30 "0" */
    0x5, 0xfb, 0xea, 0x1, 0xe5, 0x1, 0xe5, 0x5e, 
    0x10, 0xa, 0x77, 0xc0, 0x0, 0x7a, 0x7a, 0x0, 
    0x7, 0xa7, 0xa0, 0x0, 0x7a, 0x5c, 0x0, 0x7, 
    0xa1, 0xd3, 0x0, 0xc5, 0xa, 0xd6, 0xae, 0x10, 
    0x7, 0xdb, 0x20, 

    /* U+31 "1" */
    0x1, 0xe3, 0xff, 0x73, 0xa0, 0xa, 0x0, 0xa0, 
    0xa, 0x0, 0xa0, 0xa, 0x0, 0xa0, 0x7, 

    /* U+32 "2" */
    0x0, 0x37, 0x60, 0x0, 0x9f, 0xbd, 0xe1, 0x5e, 
    0x20, 0xc, 0x70, 0x20, 0x0, 0xc7, 0x0, 0x0, 
    0x3e, 0x30, 0x0, 0xa, 0xa0, 0x0, 0x7, 0xe1, 
    0x0, 0x3, 0xe3, 0x0, 0x3, 0xf5, 0x0, 0x1, 
    0xec, 0x55, 0x53, 0x3a, 0xaa, 0xaa, 0xe, 

    /* U+33 "3" */
    0x2, 0x54, 0x0, 0x6f, 0xad, 0xe1, 0xd3, 0x0, 
    0xc7, 0x20, 0x0, 0xc7, 0x0, 0x6, 0xe1, 0x1, 
    0xef, 0x70, 0x0, 0x3, 0xf5, 0x0, 0x0, 0xaa, 
    0xc0, 0x0, 0xa7, 0xcc, 0x59, 0xf3, 0x9, 0xdc, 
    0x20, 

    /* U+34 "4" */
    0x0, 0x0, 0xac, 0x0, 0x0, 0x7f, 0xc0, 0x0, 
    0x3e, 0x8c, 0x0, 0xc, 0x75, 0xc0, 0x7, 0xc0, 
    0x5c, 0x3, 0xd1, 0x5, 0xc0, 0xcd, 0xaa, 0xcf, 
    0x94, 0x55, 0x58, 0xd6, 0x0, 0x0, 0x5c, 0x0, 
    0x0, 0x3, 0x70, 

    /* U+35 "5" */
    0x7, 0xfd, 0xdd, 0x50, 0xa5, 0x0, 0x0, 0x1d, 
    0x30, 0x0, 0x3, 0xff, 0xff, 0x60, 0x5b, 0x20, 
    0x5e, 0x30, 0x0, 0x0, 0xaa, 0x0, 0x0, 0xa, 
    0xaa, 0x70, 0x0, 0xc7, 0x5f, 0x75, 0xce, 0x10, 
    0x5c, 0xda, 0x20, 

    /* U+36 "6" */
    0x0, 0x7c, 0x0, 0x3, 0xe3, 0x0, 0xc, 0x70, 
    0x0, 0x5f, 0xcd, 0x60, 0xec, 0x35, 0xda, 0xe1, 
    0x0, 0x3d, 0xc0, 0x0, 0x3e, 0xe1, 0x0, 0x5e, 
    0xcc, 0x35, 0xf7, 0x9, 0xdd, 0x70, 

    /* U+37 "7" */
    0xdd, 0xdd, 0xfe, 0x0, 0x0, 0xa7, 0x0, 0x5, 
    0xc0, 0x0, 0xc, 0x50, 0x0, 0x5e, 0x10, 0x0, 
    0xa7, 0x0, 0x1, 0xd3, 0x0, 0x5, 0xc0, 0x0, 
    0xa, 0x70, 0x0, 0x8, 0x30, 0x0, 

    /* U+38 "8" */
    0xa, 0xea, 0xdc, 0x3, 0xd1, 0x0, 0xc5, 0x3b, 
    0x0, 0xc, 0x51, 0xe8, 0x28, 0xe1, 0x7, 0xff, 
    0xf6, 0x5, 0xf5, 0x2, 0xe7, 0x7a, 0x0, 0x7, 
    0xa7, 0xa0, 0x0, 0x7a, 0x5f, 0x85, 0x7f, 0x50, 
    0x5c, 0xdc, 0x50, 

    /* U+39 "9" */
    0xc, 0xfc, 0xfc, 0x7, 0xe1, 0x1, 0xe7, 0xa7, 
    0x0, 0xa, 0xaa, 0xa0, 0x0, 0xc7, 0x5f, 0x50, 
    0x7f, 0x30, 0x7f, 0xff, 0xa0, 0x0, 0x5, 0xf3, 
    0x0, 0x0, 0xc7, 0x0, 0x0, 0x5e, 0x10, 0x0, 
    0xb, 0x50, 0x0, 

    /* U+e677 "" */
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 
    0x97, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x5, 0xff, 0xff, 0x30, 0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf, 0xff, 
    0xfa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5d, 0xf9, 
    0x10, 0xc, 0xff, 0xff, 0xc0, 0x0, 0x0, 0x0, 
    0x7, 0xff, 0xff, 0xff, 0xc3, 0x7f, 0xff, 0xf7, 
    0x0, 0x0, 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, 
    0xff, 0xef, 0xf9, 0x0, 0x0, 0x0, 0xa, 0xff, 
    0xf7, 0x0, 0x6f, 0xff, 0xfe, 0x10, 0x0, 0x0, 
    0x0, 0x0, 0x29, 0x50, 0x0, 0x0, 0xaf, 0xff, 
    0xfa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x9f, 0xff, 0xff, 0xf3, 0x0, 0x0, 0x2, 
    0x55, 0x55, 0x55, 0x30, 0xaf, 0xff, 0xff, 0xff, 
    0x70, 0x0, 0x0, 0x7f, 0xff, 0xff, 0xa0, 0xaf, 
    0xff, 0xff, 0xff, 0xff, 0xbe, 0xff, 0x70, 0x0, 
    0x0, 0x0, 0x7f, 0xff, 0xff, 0xf6, 0x7f, 0xff, 
    0xff, 0xf7, 0x3a, 0xaa, 0xa3, 0x1e, 0xff, 0xff, 
    0xf5, 0x0, 0xcf, 0xfe, 0x94, 0x7, 0xdd, 0xdd, 
    0x91, 0xef, 0xff, 0xfa, 0x0, 0x0, 0x10, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x3, 0xff, 0xff, 0xe1, 
    0x0, 0x0, 0x0, 0x0, 0x3, 0xaa, 0xaa, 0xaa, 
    0x53, 0xff, 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, 
    0x6f, 0xff, 0xff, 0xff, 0x52, 0xef, 0xff, 0x70, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x1, 0xef, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0, 0x17, 0xcf, 0xff, 0xfc, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 
    0xff, 0xff, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0xaf, 0xff, 0xfe, 0x96, 0x50, 0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x97, 0x30, 0x9f, 
    0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x5f, 0xff, 0x30, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0xff, 0x50, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0xa, 0xff, 0xa0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0, 0x3, 0xff, 0xe1, 0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 
    0xf3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
};

/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
/* id = 0 reserved */  {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
/* U+20 " " */  {.bitmap_index = 0, .adv_w = 120, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = -1},
/* U+30 "0" */  {.bitmap_index = 1, .adv_w = 120, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
/* U+31 "1" */  {.bitmap_index = 36, .adv_w = 120, .box_w = 3, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
/* U+32 "2" */  {.bitmap_index = 51, .adv_w = 120, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
/* U+33 "3" */  {.bitmap_index = 90, .adv_w = 120, .box_w = 6, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
/* U+34 "4" */  {.bitmap_index = 123, .adv_w = 120, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
/* U+35 "5" */  {.bitmap_index = 158, .adv_w = 120, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
/* U+36 "6" */  {.bitmap_index = 193, .adv_w = 120, .box_w = 6, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
/* U+37 "7" */  {.bitmap_index = 223, .adv_w = 120, .box_w = 6, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
/* U+38 "8" */  {.bitmap_index = 253, .adv_w = 120, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
/* U+39 "9" */  {.bitmap_index = 288, .adv_w = 120, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
/* U+e677 "" */  {.bitmap_index = 323, .adv_w = 424, .box_w = 23, .box_h = 27, .ofs_x = 2, .ofs_y = -3},
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_1[] = {

    0x20, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 
    0x37, 0x38, 0x39, 0xe677, 
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 0, .range_length = 58999, .glyph_id_start = 1,
        .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 12, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};

/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/
/*Store all the custom data of the font*/
static lv_font_fmt_txt_dsc_t font_dsc = {
    .glyph_bitmap = gylph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0
};

/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
lv_font_t run_font_16 = {
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 27,          /*The maximum line height required by the font*/
    .base_line = 3,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if RUN_FONT_16*/
